package com.yuanfengerp.inventorycheck.missioncheck.contorller;

import com.yuanfengerp.inventorycheck.missioncheck.model.Checktask;
import com.yuanfengerp.inventorycheck.missioncheck.service.impl.ChecktaskServiceImpl;
import com.yuanfengerp.publicUtil.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@CrossOrigin
public class ChecktaskCon {
    @Autowired
    ChecktaskServiceImpl csil;

    @PostMapping("/selectTaskAll")
    public Result selectTaskAll(@RequestBody Map<String, Object> params) {
        return csil.selectTaskAll(params);
    }

    @PostMapping("/selectTaskAndshopAll")
    public Result selectTaskAndshopAll(String document_ID) {
        return csil.selectTaskAndshopAll(document_ID);
    }

    @PostMapping("/addTask")
    public Result addTask(@RequestBody Checktask checktask) {
        return csil.addTask(checktask);
    }


    @PostMapping("/deleteTask")
    public Result deleteTask(String document_ID) {
        return csil.deleteTask(document_ID);
    }
}
